<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="template-head.jsp" />
<jsp:include page="template-body.jsp" />
<div class="container">
	<jsp:include page="errors.jsp"/>
<div id="multiplechoicequestionpage">
	<c:choose>
		<c:when test="${question.type == 5}">
		<h1>Multiple Choice Type Question</h1>
		</c:when>
		<c:when test="${question.type == 6}">
		<h1>Multiple Selection Type Question</h1>
		</c:when>
		<c:when test="${question.type == 7}">
		<h1>Rank Order Type Question</h1>
		</c:when>
		<c:when test="${question.type == 11}">
		<h1>Network Weighted List Type Question</h1>
		</c:when>
		<c:otherwise>
		<h1>Network Rank Order Type Question</h1>
		</c:otherwise>
	</c:choose>
	<div id="multiplechoicequestionbody">
	<div class="hero-unit">
	<c:choose>
		<c:when test="${multiplechoice == 1}">
		<form id="multiplechoicequestionform" method="post" action="multiplechoiceq.do">
			<div id="multiplechoicequestiontext">
				<textarea name="question" rows="10" cols="100">Type your question here.</textarea>
			</div>
			<div id="multiplechoicequestiondynetmlattr">
			<c:choose>
				<c:when test="${network == true}">
				<p>Enter the dynetml network identifier for this question.</p>
				</c:when>
				<c:otherwise>
				<p>Enter the dynetml attribute identifier for this question.</p>
				</c:otherwise>
			</c:choose>
			<input type="text" name="dynetmlAttr" value="${mcform.dynetmlAttr}">
			</div>
			
			<c:if test="${network == true}"> <%-- Network Weighted List / Network Rank Order Question --%>
			<div id="multiplechoicequestionclassname">
				<p>Select the name of entity class for this question.</p>
				<select name="className" class="type">
					<c:forEach var="ec" items="${entityclass}">
					<option>${ec.name}</option>
					</c:forEach>
				</select>
				
				<p>If you have not imported an entity class yet, please press the button below to import one for this survey.</p>
				<input type="submit" name="button" class="btn btn-success" value="Import Entity Data"><br/><br/>
			</div>
			</c:if>
			<c:if test="${question.type != 13}"> <%-- Non-network Multiple Choice / Selection / Rank Order, Network Weighted List Question --%>
			<div id="multiplechoicequestionnum">
				Enter number of choices (2 - 100)
				<input name="num" type="text" value="${mcform.num}">
			</div>
			</c:if>
			<div id="multiplechoicequestionbutton">
				<table>
					<tr>
						<td><input type="submit" name="button" class="btn btn-success"  value="Next"></td>
					</tr>
					<tr>
						<td><input type="submit" name="button" class="btn btn-inverse"  value="Back"></td>
					</tr>
				</table>
			</div>
		</form>
		</c:when>
		
		<c:otherwise>
		<form id="multiplechoicequestionform" method="post" action="multiplechoiceq.do">
			<div id="multiplechoicequestionchoices">
			<c:choose>
				<c:when test="${question.type == 13}"> <%-- Network Rank Order Question --%>
					<p>Select the number of choices to be ranked.</p>
					<p>The target entity class has ${numEntity} entities, so any number from 1 to ${numEntity} is allowed.</p>
					<input type="text" name="numRank" value="">
				</c:when>
				<c:when test="${question.type == 11}"> <%-- Network Weighted List Question --%>
					<p>For each choices, enter the description and the weight associated with the description.</p>
					<table>
					<c:forEach var="i" begin="1" end="${multiplechoice}">
						<tr>
							<td>Choice ${i} Description: <input type="text" name="choice${i}desc" value=""></td>
							<td>Weight: <input type="text" name="choice${i}num" value=""></td>
						</tr>
					</c:forEach>
					</table>
				</c:when>
				<c:otherwise> <%-- Non-network questions (Multiple Choice, Multiple Selection, Rank Order) --%>
				<table>
				<c:forEach var="i" begin="1" end="${multiplechoice}">
					<tr>
						<td>Choice ${i}: <input type="text" name="choice${i}" value=""></td>
					</tr>
				</c:forEach>
				</table>
				</c:otherwise>
			</c:choose>
			</div>
			
			<div id="multiplechoicequestionbutton">
				<table>
					<tr>
						<td><input type="submit" name="button" class="btn btn-success"  value="Submit"></td>
					</tr>
					<tr>
						<td><input type="submit" name="button" class="btn btn-inverse"  value="Back"></td>
					</tr>
				</table>
			</div>
		</form>
		</c:otherwise>
	</c:choose>
	</div>
	</div>
</div>
</div>
<!--Create another space for contents' extension  -->
	<div class="container2">
	
	
 	</div>
<jsp:include page="template-foot.jsp" /> 